USE [OHNEW]
GO

/****** Object:  Table [dbo].[D_SalesOrder]    Script Date: 23:44 2012/12/10 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[D_SalesOrder](
	[ID] [uniqueidentifier] NOT NULL,
	[OrderType] [int] NOT NULL,
	[Code] [varchar](50) NOT NULL,
	[Customer] [uniqueidentifier] NOT NULL,
	[Company] [uniqueidentifier] NOT NULL,
	[SalesPerson] [uniqueidentifier] NULL,
	[DocumentDate] [datetime] NOT NULL,
	[Amount] [decimal](18, 2) NOT NULL,
	[DelvDate][datetime] NOT NULL,
	[ARDate][datetime]  NULL,
	[Notes] [varchar](250) NOT NULL,
	[NeedInvoice] [int] NOT NULL,
	[CPONumber] [varchar](50) NOT NULL,
	[CreatedBy] [uniqueidentifier] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[CheckStatus] [int] NULL,
	[CheckedBy] [uniqueidentifier] NULL,
	[CheckDate] [datetime] NULL,
	[Shipped] [int] NOT NULL,
	[InvoiceStatus] [int] NOT NULL,
 CONSTRAINT [PK_D_SalesOrder] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[D_SalesOrder] ADD  DEFAULT (newid()) FOR [ID]
GO


